﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using Ninject;
using Timetable.Base.Interfaces.DataSources;

namespace Timetable.Base.Interfaces.Repositories
{
    public interface IRepository<TEntity> where TEntity: class
    {
        IDatabase DataSource { get; set; }

        IQueryable<TEntity> Get(Expression<Func<TEntity, bool>> filter = null,
                                 Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderBy = null,
                                 string includeProperties = "");

        TEntity GetById(object id);

        void Insert(TEntity entity);

        void Update(TEntity entity);

        void Delete(TEntity entity);

        IEnumerable<object> GetValidationModelErrors();
    }
}
